<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>使用 Windows 构建系统：config.w32</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="internals2.buildsys.configunix.html">与 UNIX 构建系统交互: config.m4</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="internals2.structure.html">扩展的结构</a></div>
 <div class="up"><a href="internals2.buildsys.html">PHP 5 构建系统</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="internals2.buildsys.configwin" class="sect1">
  <h2 class="title">使用 Windows 构建系统：config.w32</h2>
  <p class="para">
   扩展的 <var class="filename">config.w32</var> 文件的用法与
   <var class="filename">config.m4</var> 文件类似，但有两点决定性的不同：首先，它是用于 Windows 构建的，其次，它是使用 JavaScript
   编写的。此章节不会包括 JavaScript 语法。目前，代替 Win32 试验台的这部分是不完整的，仅为例子提供的范例
   <var class="filename">config.m4</var> 的仅试验性质的移植。
  </p>
  
  <div class="example" id="internals2.buildsys.configwin.sample-config">
   <p><strong>Example #1 config.w32 文件举例</strong></p>
   <div class="example-contents"><div class="javascriptcode"><pre class="javascriptcode">// $Id$
// vim:ft=javascript</pre>
</div><div class="javascriptcode"><pre class="javascriptcode">ARG_WITH(&quot;example&quot;, &quot;for example support&quot;, &quot;no&quot;);
ARG_ENABLE(&quot;example-debug&quot;, &quot;for debugging support in example&quot;, &quot;no&quot;)
ARG_WITH(&quot;example-extra&quot;, &quot;for extra functionality in example&quot;, &quot;no&quot;)
if (PHP_EXAMPLE != &quot;no&quot;) {
    if (CHECK_LIB(&quot;libexample.lib&quot;, &quot;example&quot;, PHP_EXAMPLE) &amp;&amp;
        CHECK_HEADER_ADD_INCLUDE(&quot;example.h&quot;, &quot;CFLAGS_EXAMPLE&quot;, PHP_EXAMPLE + &quot;\\include&quot;)) {
        
        if (PHP_EXAMPLE_DEBUG != &quot;no&quot;) {
            AC_DEFINE(&#039;USE_EXAMPLE_DEBUG&#039;, 1, &#039;Debug support in example&#039;);
        }
        
        if (PHP_EXAMPLE_EXTRA != &quot;no&quot; &amp;&amp;
            CHECK_LIB(&quot;libexample-extra.lib&quot;, &quot;example&quot;, PHP_EXAMPLE) &amp;&amp;
            CHECK_HEADER_ADD_INCLUDE(&quot;example-extra.h&quot;, &quot;CFLAGS_EXAMPLE&quot;, PHP_EXAMPLE + &quot;;&quot; + PHP_PHP_BUILD + &quot;\\include&quot;) {
            AC_DEFINE(&#039;HAVE_EXAMPLEEXTRA&#039;, 1, &#039;Extra functionality in example&#039;);
            HAVE_EXTRA = 1;
        } else {
            WARNING( &quot;extra example functionality not enabled, lib not found&quot; );
        }
        
        EXTENSION(&quot;example&quot;, &quot;example.c&quot;);
        if (HAVE_EXTRA == 1) {
            ADD_SOURCES(&quot;example-extra.c&quot;);
        }
    } else {
        WARNING( &quot;example not enabled; libraries not found&quot; );
    }
}</pre>
</div>
   </div>

  </div>

  <div class="sect2" id="internals2.buildsys.configwin.counter">
   <h3 class="title">counter 扩展的 config.w32 文件</h3>
   <p class="para">
    因为不使用很多构建系统的特性，以前所记载的 counter 扩展有一个比上面所描述的例子更简单的
    <var class="filename">config.w32</var> 文件。
   </p>
   <div class="example" id="internals2.buildsys.configwin.counter.configwin">
    <p><strong>Example #2 counter&#039;s config.w32 file</strong></p>
    <div class="example-contents"><div class="autoconfcode"><pre class="autoconfcode">// $Id$
// vim:ft=javascript</pre>
</div><div class="autoconfcode"><pre class="autoconfcode">ARG_ENABLE(&quot;counter&quot;, &quot;for counter support&quot;, &quot;no&quot;);
if (PHP_COUNTER != &quot;no&quot;) {
    EXTENSION(&quot;counter&quot;, &quot;counter.c&quot;);
    ADD_SOURCE(&quot;counter-util.c&quot;);
}</pre>
</div>
    </div>

   </div>
  </div>

 </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="internals2.buildsys.configunix.html">与 UNIX 构建系统交互: config.m4</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="internals2.structure.html">扩展的结构</a></div>
 <div class="up"><a href="internals2.buildsys.html">PHP 5 构建系统</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
